package com.gibs.peixunapi.model;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Table(name = "test_paper_subject",
		uniqueConstraints = @UniqueConstraint(columnNames = {"test_paper_id", "subject_hub_id"}))
public class TestPaperSubject extends BaseModel  {	//试卷题目
	@ManyToOne(cascade = CascadeType.REFRESH)
	private TestPaper testPaper;     //试卷id
	@OneToOne(cascade = CascadeType.REFRESH)
	private SubjectHub subjectHub;     //题目id
	@ManyToOne
	private User creator;     //创建人
	private Integer sort;		//排序
	private Integer type;     //类型
//TODO 添加testPaperId,subjectHubId 联合索引

}

